<?php
  if($item->isRoot() && (!isset($display_root) || $display_root == false))
    return;

  $chain = array();
  while($parent = $item->getParent())
  {
    if($parent->isRoot())
      break;

    $chain[] = $item = $parent;
  }

  if(isset($root_path))
    $chain[] = array('root_path' => $root_path,
                     'root_title' => (isset($root_title) ? $root_title : 'Главная страница'));

  $chain = array_reverse($chain);

?>
{{list using='$chain' counter="$counter"}}
  <div class="breadcrumbs">
    {{list:item}}
      <? if(isset($root_path) && ($counter == 1)){ ?>
        <a href='{$item["root_path"]}'><b>{$item["root_title"]}</b></a>&nbsp;&raquo;
      <? }else{ ?>
        <a href='{$base_path}{$item[$link_field]}'><b>{$item.title}</b></a>&nbsp;&raquo;
      <? } ?>
    {{/list:item}}
    {$#item.title}
  </div>
{{/list}}
